package com.showsu.editor.entity.bigmodel;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @Author: William
 * @Description: https://bigmodel.cn/dev/api/normal-model/glm-4，请求对象
 * @Date: Created in 7:08 下午 2024/10/9
 * @Modified By:
 */
@NoArgsConstructor
@Data
public class ChatCompletionsRequest implements Serializable {
    private String model;
    private List<MessagesDTO> messages;
    private Double top_p;
    private Double temperature;
    private Integer max_tokens;
    private List<ToolsDTO> tools;

    @NoArgsConstructor
    @Data
    public class MessagesDTO {
        private String role;
        private String content;
    }

    @NoArgsConstructor
    @Data
    public class ToolsDTO {
        private String type;
        private RetrievalDTO retrieval;
        private webSearchDTO web_search;


        @NoArgsConstructor
        @Data
        public class RetrievalDTO {
            private String knowledge_id;
        }

        @NoArgsConstructor
        @Data
        public class webSearchDTO {
            private Boolean enable;
        }
    }
}
